<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <title>书籍表单</title>
</head>
<body>
<h1>书籍表单</h1>

<!-- 表单 -->
<form th:action="@{/submit-book}" th:object="${book}" method="post">
  <div>
    <label for="id">ID:</label>
    <input type="number" id="id" th:field="*{id}">
  </div>
  <div>
    <label for="type">类型:</label>
    <input type="text" id="type" th:field="*{type}" required>
  </div>
  <div>
    <label for="name">书名:</label>
    <input type="text" id="name" th:field="*{name}" required>
  </div>
  <div>
    <label for="description">描述:</label>
    <textarea id="description" th:field="*{description}" required></textarea>
  </div>
  <div>
    <button type="submit">提交</button>
  </div>
</form>
<!-- 查看书籍详情的表单 -->
<h2>查看书籍详情</h2>
<form th:action="@{/view-book}" method="get">
  <div>
    <label for="viewId">输入书籍 ID:</label>
    <input type="number" id="viewId" name="id" required>
    <button type="submit">查看</button>
  </div>
</form>
<h2>删除书籍</h2>
<form th:action="@{/delete-book}" method="post">
  <div>
    <label for="deleteId">输入书籍 ID:</label>
    <input type="number" id="deleteId" name="id" required>
    <button type="submit" onclick="return confirm('确定要删除这本书吗?')">删除</button>
  </div>
</form>
</body>
</html>